//
//  HJTitleView.swift
//  Micro-blog Sina
//
//  Created by admin on 16/3/24.
//  Copyright © 2016年 admin. All rights reserved.
//

import UIKit

class HJHomeTitleButton: UIButton {
    convenience init(title: String?, imageName: String) {
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(UIColor.redColor(), forState: UIControlState.Normal)
        sizeToFit()
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = (titleLabel!.frame.width + 3)
    }
}
